#include<stdio.h>
typedef struct grade
{
    long ID;
    char name[20];
    int score[3];
}GRA;
int main()
{
    int n;
    scanf("%d", &n);
    GRA a[100];
    for(int i = 0; i < n; i ++)
        scanf("%ld %s %d %d %d", &a[i].ID, a[i].name, &a[i].score[0], &a[i].score[1], &a[i].score[2]);
    long s;
    int flag = 0;
    scanf("%ld", &s);
    for(int i = 0; i < n; i ++)
    {
        if(s == a[i].ID)
        {
            flag = 1;
            printf("%ld %s %d %d %d", a[i].ID, a[i].name, a[i].score[0], a[i].score[1], a[i].score[2]);
        }
    }
    if(flag == 0)
        printf("Not Found");
    return 0;
}